package com.homework.ch02;

/**
 * @author yuxi
 * @version 1.0
 * @date 2025/10/23
 * @Description:
 */
interface Action01{
    int run(String str);
}
public class Test {
    public static int len(String str){
        return str.length();
    }
    public static void main(String[] args) {
        Action01 a1= new Action01() {
            @Override
            public int run(String str) {
                return Test.len(str);
            }
        };
        Action01 a2=(str)->Test.len(str);
        Action01 a3=Test::len;
        System.out.println(a1.run("hello"));
        System.out.println(a2.run("hello"));
        System.out.println(a3.run("hello"));

    }
}
